<?php

// uncomment the following to define a path alias
// Yii::setPathOfAlias('local','path/to/local-folder');

return array(
	'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
	'name'=>'Интернет-магазин STANDBY',
    'language'=>'ru',

	'preload'=>array('log'),

	'import'=>array(
		'application.models.*',
		'application.components.*',
		'ext.yiiext.components.shoppingCart.*',
	),

	'behaviors'=>array(
	  'runEnd'=>array(
	  'class'=>'application.behaviors.WebApplicationEndBehavior',
	  ),
	),

	'modules' => array(
		'gii' => array(
			'class' => 'system.gii.GiiModule',
			'password' => 'alex',
		),
        'backend' => array(
            'title'=>'Панель администрирования',
        ),
        'profile' => array(
            'title' => 'Профиль пользователя',
        ),
	),

	'components'=>array(
	
	    'shoppingCart' =>
			array(
				'class' => 'ext.yiiext.components.shoppingCart.EShoppingCart',
			),
			
		'user'=>array(
			// enable cookie-based authentication
			'allowAutoLogin'=>true,
		),
		// uncomment the following to enable URLs in path-format

        'db'=>array(
     		'connectionString' => 'mysql:host=localhost;dbname=release2',
     		'emulatePrepare' => true,
     		'username' => 'admin',
     		'password' => 'admin',
     		'charset' => 'utf8',
     		'tablePrefix' => 'prefix_',
            'enableProfiling'=>true,
     		'enableParamLogging' => true,
     	),

        'errorHandler'=>array(
     	    'errorAction'=>'site/error',
     	),

        'urlManager'=>array(
     				'urlFormat'=>'path',
     				'showScriptName'=>false,
     				'rules'=>array(
     					array(
     						'class' => 'application.components.yiistoUrlRule',
     						'connectionID' => 'db',
     					),
     					'/'=>'site/index',
     					'sitemap.xml'=>'site/sitemap',
     					'cart.html'=>'cart/index',
                        'search.html'=>'search/index',
     					'checkout.html'=>'checkout/index',
     					'inStock'=>'category/stock',
     					'inDiscount'=>'category/discount',
     					'content'=>'content/index',
     					'<controller:\w+>/<id:\d+>'=>'<controller>/view',
     					'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
     					'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
     				),
     	),

        'log'=>array(
     				'class'=>'CLogRouter',
     				'routes'=>array(
     					/*
     					array(
     						'class'=>'CFileLogRoute',
     						'levels'=>'error, warning',
     					),
     					array(
     						'class'=>'CWebLogRoute',
     					),
     					*/
                         array(
     						'class'=>'ext.db_profiler.DbProfileLogRoute',
                             'countLimit' => 1, // How many times the same query should be executed to be considered inefficient
                             'slowQueryMin' => 0.01, // Minimum time for the query to be slow
                         ),
     				),
     	),

	),
	

	// application-level parameters that can be accessed
	// using Yii::app()->params['paramName']
	'params'=>array(
		'adminEmail'=>'usualdesigner@gmail.com',
        'currency'=>'UAH',
        'offline'=>true,
	),
);